***** Replication code for Franchino, Fabio, and Camilla Mariotto. “Noncompliance Risk, Asymmetric Power and the Design of Enforcement of the European Economic Governance”. European Union Politics.

***** Online Appendix Section 6. Results without controlling for Common source
* Table A12: Governmental positions on national discretion and enforcement regimes without variable for Common source
version 15
pause on
use conflict_data_FC2.dta, clear

* Generalized structural equation model: Three-levels, Random intercepts
gsem (discr_com <- c.debt_gdp c.nbi c.nbi#c.debt_gdp i.eurozone i.crisis@0 i.cou_pres c.gov_lr c.gov_eu c.goodEU_net_6 M1[act] M2[act>issue_id], ologit ) ///
	 (discr_cou <- c.debt_gdp c.nbi c.nbi#c.debt_gdp i.eurozone i.crisis@0 i.cou_pres c.gov_lr c.gov_eu c.goodEU_net_6 M1[act] M2[act>issue_id], ologit ) ///
     (discr_nat <- c.debt_gdp                        i.eurozone i.crisis   i.cou_pres c.gov_lr c.gov_eu c.goodEU_net_6 M1[act] M2[act>issue_id], ologit ), vce(robust) nolog

pause /* type q to proceed */
 
* Effects of crisis
margins, dydx(crisis)

pause /* type q to proceed */

* Figure A8: Marginal effect of noncompliance risk on preferring Council involvement, over voting power from the model in Table A12
* Substantive effects: Council Discretion
* Code from Thomas Brambor, William Roberts Clark, Matt Golder, Political Analysis 14: 63-82)
matrix b=e(b)
matrix list b
scalar b15=b[1,15]
scalar b17=b[1,17]
sca dir
matrix V=e(V)
matrix list V
scalar varb15=V[15,15]
scalar varb17=V[17,17]
scalar covb15b17=V[15,17]
sca dir
generate MVZ=(_n+8)/10
replace  MVZ=. if _n>123
gen conbx=b15+b17*MVZ if _n<=123
gen consx=sqrt(varb15+varb17*(MVZ^2)+2*covb15b17*MVZ) if _n<=123
gen ax=1.96*consx
gen upperx=conbx+ax
gen lowerx=conbx-ax
gen where=-0.015 
gen pipe = "|" 
egen tag_nbi = tag(nbi)
gen yline=0
graph twoway hist nbi, width(0.5) percent color(gs14) yaxis(2) ///
		|| scatter where nbi if tag_nbi, plotr(m(b 4)) ms(none) mlabcolor(gs5) mlabel(pipe) mlabpos(6) legend(off)  ///
		||   line conbx   MVZ, clpattern(solid) clwidth(medium) clcolor(black) yaxis(1)  ///
        ||   line upperx  MVZ, clpattern(dash) clwidth(thin) clcolor(black)  ///
        ||   line lowerx  MVZ, clpattern(dash) clwidth(thin) clcolor(black)  ///
        ||   line yline  MVZ,  clwidth(thin) clcolor(black) clpattern(solid) || , ///
			 xlabel(1 5 10, noticks nogrid labsize(2)) xscale(noline) ylabel( 0 0.5 1 1.5, noticks axis(1) nogrid labsize(2))  ///
		     ylabel(0 5 10 15 20, noticks axis(2) nogrid labsize(2)) yscale(noline alt) yscale(noline alt axis(2)) legend(off) ///			 
			 title("" , size(2.5)) xtitle("Voting power (%)" , size(2.5)) ytitle("Marginal effect of {it:noncompliance risk}" , axis(1) size(2.5)) ytitle("" , axis(2) size(2.5)) ///
			 xsca(titlegap(2) r(0.3 1.5)) ysca(titlegap(2)) scheme(s2mono) graphregion(fcolor(white) ilcolor(white) lcolor(white)) saving(figureA8, replace)
